<template>
  <div class="app-container">
    <el-card shadow="always">
      <h1 style="text-align: center"  >{{reportDetail.reportTitle}}</h1>
      <h4 style="text-align: center" v-text="reportDetail.studentName"></h4>
      <div>
        <div v-if="reportDetail.contentType===0">
          <div v-html="reportDetail.content" ></div>
        </div>
        <div v-if="reportDetail.contentType===1">
          下载文档
          <a :href="reportDetail.fileUrl" :download="templateName" ><el-button icon="el-icon-document" circle></el-button></a>
          <el-button type="primary" icon="el-icon-edit" circle></el-button>
        </div>
      </div>
       提交时间：{{reportDetail.createTime}}
       <el-divider></el-divider>
       <div>
            评语：
            <el-input
            type="textarea"
            :autosize="{ minRows: 2, maxRows: 4}"
            placeholder="请输入内容"
            v-model="score.reason" :disabled="true">
            </el-input>
            分数：
            <el-input v-model="score.resultValue" :disabled="true"></el-input>
            审核时间：
            <el-input v-model="score.createTime" :disabled="true"></el-input>
            审核人：
            <el-input v-model="score.teachName" :disabled="true"></el-input>
       </div>
    </el-card>
  </div>
</template>
<script>
import { getReport } from '@/api/report'
import { getReportResult } from '@/api/result'
export default {
  data() {
    return {
      reportDetail:{},
      param:{
        reportId:''
      },
       options: [{
          value: '1',
          label: '审核通过'
        }, {
          value: '2',
          label: '驳回'
        }],
        score:{
        },
    }
  },
  //页面打开时执行的方法
  created() {
    this.param.reportId = this.$route.query.reportId;
    this.getReport();
    this.getReportResult();
  },
   methods: {
     async getReport(){
          let res = await getReport(this.param);
          this.reportDetail =res.bean;
      },
      async getReportResult() {
        let res = await getReportResult(this.param)
        this.score = res.bean
      }
   }
}
</script>
